﻿using System;

namespace GcdAndLcm
{
    internal class Program
    {
        static int Gcd(int a, int b)
        {
            if (b == 0)
            {
                return a;
            }
            return Gcd(b, a % b);
        }
        static int Lcm(int a, int b)
        {
            return a * b / Gcd(a, b);
        }
        static void Main(string[] args)
        {
            Console.WriteLine("请输入两个正整数：");
            Console.Write("第一个数 m = ");
            int m = int.Parse(Console.ReadLine());

            Console.Write("第二个数 n = ");
            int n = int.Parse(Console.ReadLine());

            Console.WriteLine($"最大公约数(GCD): " + Gcd(m, n));
            Console.WriteLine($"最小公倍数(LCM): " + Lcm(m, n));
        }
    }
}
